package cz.muni.fi.hauntedhouses.dao;

import cz.muni.fi.hauntedhouses.to.GhostTO;
import java.util.List;

/**
 *
 * @author Martin Vala, 359917
 */
public interface GhostDAO {
    
    /**
     * Creates given ghost
     * 
     * @param ghost Ghost object to be created
     * @throws IllegalArgumentException If given object is null or not a ghost Object
     */    
    void create(GhostTO ghost);
    
    /**
     * Returns ghost with given ID
     * 
     * @param id ID of a ghost which we want to find
     * @return Ghost object with given ID
     * @throws IllegalArgumentException If given ID is null or is not Long
     */
    GhostTO get(Long id);
    
    /**
     * Updates information of given ghost
     * 
     * @param ghost Ghost object with information we want to update
     * @throws IllegalArgumentException If given object is null or not a ghost Object
     * @throws //TODO Ghost not found exception
     */
    void update(GhostTO ghost);
    
    /**
     * Removes given ghost
     * 
     * @param ghost Ghost object to be removed
     * @throws IllegalArgumentException If given object is null or not a ghost Object
     */
    void remove(GhostTO ghost);
    
    /**
     * Finds all ghosts and returns list of them
     * 
     * @return All ghosts in a list
     */
    List<GhostTO> findAll();
    
    /**
     * Finds all ghosts with given name
     * 
     * @param name Name of ghost which we want to find
     * @return List of ghosts with given name
     * @throws IllegalArgumentException If name is null or not a String
     */
    List<GhostTO> findByName(String name);
}
